/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "far_egreso_detalle")
@NamedQueries({
    @NamedQuery(name = "FarEgresoDetalle.findAll", query = "SELECT f FROM FarEgresoDetalle f")})
public class FarEgresoDetalle implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "fed_id")
    private Integer fedId;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "fed_cantidad")
    private BigDecimal fedCantidad;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fed_estado")
    private int fedEstado;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fed_total")
    private BigDecimal fedTotal;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fed_valor_unitario")
    private BigDecimal fedValorUnitario;
    @OneToMany(mappedBy = "farEgresoDetalle", fetch = FetchType.LAZY)
    private List<FarAjustesDetalle> farAjustesDetalleList;
    @JoinColumn(name = "fsk_id", referencedColumnName = "fsk_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarStock farStock;
    @JoinColumn(name = "feg_id", referencedColumnName = "feg_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarEgreso farEgreso;
    @OneToMany(mappedBy = "farEgresoDetalle", fetch = FetchType.LAZY)
    private List<HosStockMedicamentos> hosStockMedicamentosList;

    public FarEgresoDetalle() {
    }

    public FarEgresoDetalle(Integer fedId) {
        this.fedId = fedId;
    }

    public FarEgresoDetalle(Integer fedId, BigDecimal fedCantidad, int fedEstado, BigDecimal fedTotal, BigDecimal fedValorUnitario) {
        this.fedId = fedId;
        this.fedCantidad = fedCantidad;
        this.fedEstado = fedEstado;
        this.fedTotal = fedTotal;
        this.fedValorUnitario = fedValorUnitario;
    }

    public Integer getFedId() {
        return fedId;
    }

    public void setFedId(Integer fedId) {
        this.fedId = fedId;
    }

    public BigDecimal getFedCantidad() {
        return fedCantidad;
    }

    public void setFedCantidad(BigDecimal fedCantidad) {
        this.fedCantidad = fedCantidad;
    }

    public int getFedEstado() {
        return fedEstado;
    }

    public void setFedEstado(int fedEstado) {
        this.fedEstado = fedEstado;
    }

    public BigDecimal getFedTotal() {
        return fedTotal;
    }

    public void setFedTotal(BigDecimal fedTotal) {
        this.fedTotal = fedTotal;
    }

    public BigDecimal getFedValorUnitario() {
        return fedValorUnitario;
    }

    public void setFedValorUnitario(BigDecimal fedValorUnitario) {
        this.fedValorUnitario = fedValorUnitario;
    }

    public List<FarAjustesDetalle> getFarAjustesDetalleList() {
        return farAjustesDetalleList;
    }

    public void setFarAjustesDetalleList(List<FarAjustesDetalle> farAjustesDetalleList) {
        this.farAjustesDetalleList = farAjustesDetalleList;
    }

    public FarStock getFarStock() {
        return farStock;
    }

    public void setFarStock(FarStock farStock) {
        this.farStock = farStock;
    }

    public FarEgreso getFarEgreso() {
        return farEgreso;
    }

    public void setFarEgreso(FarEgreso farEgreso) {
        this.farEgreso = farEgreso;
    }

    public List<HosStockMedicamentos> getHosStockMedicamentosList() {
        return hosStockMedicamentosList;
    }

    public void setHosStockMedicamentosList(List<HosStockMedicamentos> hosStockMedicamentosList) {
        this.hosStockMedicamentosList = hosStockMedicamentosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fedId != null ? fedId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FarEgresoDetalle)) {
            return false;
        }
        FarEgresoDetalle other = (FarEgresoDetalle) object;
        if ((this.fedId == null && other.fedId != null) || (this.fedId != null && !this.fedId.equals(other.fedId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.FarEgresoDetalle[ fedId=" + fedId + " ]";
    }
    
}
